import message from "@/utils/message"

export function useUiPageTableHook(storeAdapterConfig, callback) {
    // 删除
    const deleteHook = (row) => {
        message.confirm("是否确认删除该条数据", async res => {
            if (res) {
                // 删除
                storeAdapterConfig.deleteRow(row).then(result => {
                    // 删除成功callback
                    callback && callback("deleteHook")
                })
            }
        })
    }
    return { deleteHook }
}